import 'package:dio/dio.dart';
import 'package:mmkv/mmkv.dart';

import '../constants.dart';

class TokenInterceptor extends Interceptor {
  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    options.headers['Authorization'] =
        'Bearer ${MMKV.defaultMMKV().decodeString(kKeyToken)}';
    options.headers['x-org-id'] = '${MMKV.defaultMMKV().decodeString(kKeyOrgId)}';
    super.onRequest(options, handler);
    options.headers['x-api-client'] = 'clicms';
    options.headers['x-api-key'] = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0IjoiayIsImlhdCI6MTYwNDE2MjIwOTA3Nn0.dFAcDof2eGzbc6X5KIqxkXKqGB7u3KJHkJQryDeK3Is';
  }
}
